home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
201-225
/
disk_222
/
plplot
/
src
/
source.zoo
/
plhrsh.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-15
|
1KB
|
50 lines
/* Writes the Hershey symbol "ch" centred at the physical */
/* coordinate (x,y) */
#include "plplot.h"
void plhrsh(ch,x,y)
int ch, x, y;
{
int cx, cy, k, penup;
short int xygrid[300];
float symdef, symht, scale, xscale, yscale, xpmm, ypmm;
gsym(&symdef,&symht);
gpixmm(&xpmm,&ypmm);
k = 5;
penup = 1;
scale = 0.05 * symht;
if (!plcvec(ch,xygrid)) {
movphy(x,y);
return;
}
/* Compute how many physical pixels correspond to a character pixel */
xscale = scale * xpmm;
yscale = scale * ypmm;
for(;;) {
cx = xygrid[k];
k = k+1;
cy = xygrid[k];
k = k+1;
if (cx == -64 && cy == -64) {
movphy(x,y);
return;
}
else if (cx == -64 && cy == 0)
penup = 1;
else {
if (penup != 0) {
movphy(round(x+xscale*cx),round(y+yscale*cy));
penup = 0;
}
else
draphy(round(x+xscale*cx),round(y+yscale*cy));
}
}
}